import request from "@/api/product/category"
const state = {
    CategoryAllList:[]
}

const mutations = {
    CATEGORYALL_LIST(state,cate1){
        state.CategoryAllList = cate1
    }
}

const actions = {
    async Category1Actions({commit},{Category1Id,Category2Id,Category3Id}){
        try {
            let result = await request.getCategoryAllid(Category1Id,Category2Id,Category3Id)
            commit('CATEGORYALL_LIST',result.data)
        } catch (error) {
            console.log(error);
        }
    },
    async DeleteActions({commit},attrId){
        try {
            await request.getDeleteAttr(attrId)
        } catch (error) {
            console.log('删除标签失败');
        }
    },
    async SaveAttrActions({commit},data){
        try {
            await request.getSaveAttrInfo(data)
        } catch (error) {
            console.log(error);
        }
    }
}

const getters = {}

export default {
    namespaced:true,
    state,
    mutations,
    actions,
    getters
}
